namespace HeroldIT.Dnn.Modules.News.SqlProvider
{
    public static partial class TranslateNewsEntry
    {
        static partial void ToBusiness(this NewsEntry from, HeroldIT.Dnn.Modules.News.NewsEntry to);

        public static HeroldIT.Dnn.Modules.News.NewsEntry ToBusiness(this NewsEntry from)
        {
            if (null == from) return null;
            var to = new HeroldIT.Dnn.Modules.News.NewsEntry
            {
                ModuleId = from.ModuleId,
                NewsEntryId = from.NewsEntryId,
                Headline = from.Headline,
                Categories = from.Categories,
                DisplayDate = from.DisplayDate,
                PublishOn = from.PublishOn,
                PublishUntil = from.PublishUntil,
                DisplayOrder = from.DisplayOrder,
                IsSticky = from.IsSticky,
                IsHidden = from.IsHidden,
            };
            from.ToBusiness(to);
            return to;
        }

        static partial void ToLinq(this HeroldIT.Dnn.Modules.News.NewsEntry from, NewsEntry to);

        public static NewsEntry ToLinq(this HeroldIT.Dnn.Modules.News.NewsEntry from)
        {
            if (null == from) return null;
            var to = new NewsEntry
            {
                ModuleId = from.ModuleId,
                NewsEntryId = from.NewsEntryId,
                Headline = from.Headline,
                Categories = from.Categories,
                DisplayDate = from.DisplayDate,
                PublishOn = from.PublishOn,
                PublishUntil = from.PublishUntil,
                DisplayOrder = from.DisplayOrder,
                IsSticky = from.IsSticky,
                IsHidden = from.IsHidden,
            };
            from.ToLinq(to);
            return to;
        }
    }
}

